package ar.edu.unju.fi.uicomponents.validators;

import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.FacesValidator;
import javax.faces.validator.Validator;
import javax.faces.validator.ValidatorException;

import ar.edu.unju.fi.uicomponents.beans.BaseBean;

@FacesValidator(value="ValidarPassword")
public class ValidarPassword implements Validator{

	public void validate(FacesContext context, UIComponent component, Object value)
			throws ValidatorException {
		
		String valor = (String)value;
		if(valor.isEmpty()){
			
			FacesMessage msg1 = 	new FacesMessage("Password invalido", "Ingrese un valor valido......");
			msg1.setSeverity(FacesMessage.SEVERITY_ERROR);
		throw new ValidatorException(msg1);
		}
		
		
	}

}
